package com.longteng.lesson2.domain;

import com.longteng.lesson2.service.BookingService;
import com.longteng.lesson2.service.impl.FliggyBookingServiceImpl;
import com.longteng.lesson2.service.impl.QunarBookingServiceImpl;


/**
 * Created by li
 * DATE : 2018/12/2 0002
 * TIME : 22:58
 * PROJECT : java-lesson
 * PACKAGE : com.longteng.lesson
 *
 * @author <a href="mailto:55324936@qq.com">li</a>
 */
public class Boss {
    //变量名叫 bookingService
    private BookingService bookingService;

    public BookingService getBookingService() {
        return bookingService;
    }

    public void setBookingService(BookingService bookingService) {
        this.bookingService = bookingService;
    }

    public void initMethod(){
//        Boss boss=new Boss(); 相当于new对象时候的操作，和构造方法相同，执行一次
        System.out.println("初始化操作");
    }
    public void destroyMethod(){
        System.out.println("关闭方法");
    }

    Boss(){}

    /**
     * 订机票2
     * */
    public void booking(){
        //这里面是不知道进来的是携程或者飞猪或者其他
        //我是不需要做任何修改的
        //减少维护，代码更灵活，低耦合，扩展性更强
        bookingService.booking();
    }
}
